package com.yanqu.road.entity.activity.zhenhuan.config;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_zhenhuan_level", desc = "甄嬛传第二阶段妃位表")
public class ZhenHuanLevelConfig extends DataObject {
    @FieldTypeAnnotation(select = true, isIndex = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "妃位id", isIndex = true)
    private int id;
    @FieldTypeAnnotation(desc = "名称")
    private String name;
    @FieldTypeAnnotation(desc = "喜爱度")
    private int loveDegree;
    @FieldTypeAnnotation(desc = "威信")
    private int prestigeDegree;
    @FieldTypeAnnotation(desc = "开茶话会的威信度")
    private int openPartyPrestige;
    @FieldTypeAnnotation(desc = "使用邀请函的威信度")
    private int useInvitationPrestige;
    @FieldTypeAnnotation(desc = "共享的威信度")
    private int sharePrestige;
    @FieldTypeAnnotation(desc = "奖励（到达该等级）")
    private String reward;
    @FieldTypeAnnotation(desc = "茶话会持续时间秒")
    private int partyTime;
    @FieldTypeAnnotation(desc = "茶话会抢座持续时间秒")
    private int competeTime;

    private List<List<Property>> rewardList = new ArrayList<>();

    public ZhenHuanLevelConfig(ResultSet rs) throws SQLException {
        this.activityId = rs.getInt("activityId");
        this.id = rs.getInt("id");
        this.name = rs.getString("name");
        this.loveDegree = rs.getInt("loveDegree");
        this.prestigeDegree = rs.getInt("prestigeDegree");
        this.openPartyPrestige = rs.getInt("openPartyPrestige");
        this.useInvitationPrestige = rs.getInt("useInvitationPrestige");
        this.sharePrestige = rs.getInt("sharePrestige");
        this.reward = rs.getString("reward");
        this.partyTime = rs.getInt("partyTime");
        this.competeTime = rs.getInt("competeTime");
        this.rewardList = PropertyHelper.parseNewStringToPropertyList(this.reward);
    }

    public int getActivityId() {
        return activityId;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public int getLoveDegree() {
        return loveDegree;
    }

    public int getPrestigeDegree() {
        return prestigeDegree;
    }

    public int getOpenPartyPrestige() {
        return openPartyPrestige;
    }

    public int getUseInvitationPrestige() {
        return useInvitationPrestige;
    }

    public int getSharePrestige() {
        return sharePrestige;
    }

    public String getReward() {
        return reward;
    }

    public List<List<Property>> getRewardList() {
        return rewardList;
    }

    public int getPartyTime() {
        return partyTime;
    }

    public int getCompeteTime() {
        return competeTime;
    }
}
